<?php
namespace app\admin\model;

use think\Exception;
use think\Model;

class Banner extends Model{
        //首页轮播sql语句
     public static function   bannerList(){
         $list=Banner::select();
         return $list;
         }
         //首页轮播添加
     public static function   bannerAdd($data){
         $sort=Banner::column('sort');
 if (!in_array($data['sort'],$sort)){
     try{
         $res=Banner::strict(true)->insert($data);
     }catch (Exception $e){
         $res=false;
     }
     return [$res];
 }
 }






}